package com.cloudbroker.bcs.platform.dav.middle.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.cloudbroker.bcs.platform.dav.bizapi.service.business.plugs.result.ListWithExtendAppListData;
import com.cloudbroker.bcs.platform.dav.middle.dao.ExtendGroupDAO;
import com.cloudbroker.bcs.platform.dav.middle.entity.ExtendGroup;
import com.cloudbroker.bcs.platform.dav.middle.service.ExtendGroupService;
import com.cloudbroker.bcs.platform.dav.middle.service.base.TenantServiceImplBase;

@Service
public class ExtendGroupServiceImpl extends TenantServiceImplBase<ExtendGroup, String> implements ExtendGroupService{

	@Resource
	private ExtendGroupDAO extendGroupDAO;
	
	@Override
	protected ExtendGroupDAO getDAO(){
		return extendGroupDAO;
	}

	@Override
	public Long getMaxSort(ExtendGroup form) {
		Long maxNum = extendGroupDAO.getMaxSort(form);
		return maxNum == null ? 0 : maxNum+1L;
	}

	@Override
	public void deleteByCondition(String key, Integer tenant_id) {
		extendGroupDAO.deleteByCondition(key, tenant_id);
	}

    @Override
    public List<ListWithExtendAppListData> listGroupWithExtendApp(Long broker_id, Integer tenant_id) {
        return extendGroupDAO.listGroupWithExtendApp(broker_id, tenant_id);
    }

    @Override
    public void deleteAll() {
        extendGroupDAO.deleteAll();
    }
}
